import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "home" */ '../views/login')
  },
  {
    path: '/',
    name: 'Home',
    meta: { title: '主页' },
    component: () => import(/* webpackChunkName: "home" */ '../views/home')
  },
  {
    path: '/salary',
    name: 'salary',
    meta: { title: '查询工资' },
    component: () => import(/* webpackChunkName: "salary" */ '../views/salary')
  },
  {
    path: '/forWork',
    name: 'forWork',
    meta: { title: '我要报工' },
    component: () => import(/* webpackChunkName: "forWork" */ '../views/forWork')
  },
  {
    path: '/workOrder',
    name: 'workOrder',
    meta: { title: '报工查询' },
    component: () => import(/* webpackChunkName: "workOrder" */ '../views/workOrder'),
  },
  {
    path: '/workOrderDetail/:id',
    name: 'workOrderDetail',
    meta: { title: '报工详情' },
    component: () => import(/* webpackChunkName: "workOrderDetail" */ '../views/workOrderDetail')
  },
  {
    path: '/assignment',
    name: 'assignment',
    meta: { title: '作业指导书' },
    component: () => import(/* webpackChunkName: "assignment" */ '../views/assignment')
  }
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
